{extend name="default:layout:base"}

{block name="main"}
<div class="layui-row" style="margin: 10px;">
    <div class="layui-col-xs12 text-right">
        <!--只有通过api创建的小程序才能进行新增和删除-->
        <a href="https://mp.weixin.qq.com/" target="_blank" class="layui-btn layui-btn-sm layui-btn-normal">新增类目</a>
    </div>
</div>


<blockquote class="layui-elem-quote">已添加{:count($data_list)}个，最多5个，每月可修改3次</blockquote>
<table class="layui-table" lay-skin="line">
    <colgroup>
        <col width="250">
        <col >
    </colgroup>
    <thead>
    <tr>
        <th>名称</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="data_list" id="vo"}
    <tr>
        <td>{$vo.first_name} > {$vo.second_name}</td>
        <td>{$audit_status[$vo.audit_status]}</td>
        <td>
            <a  class="layui-btn layui-btn-danger layui-btn-xs js-delete" data-first="{$vo.first}" data-second="{$vo.second}">删除</a>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

{/block}

{block name="js"}
<script>
    layui.use(['jquery', 'layer'], function () {
        var $ = layui.jquery
        , layer = layui.layer;

        $(function () {
            $('.js-delete').on('click', function (e) {
                layer.confirm('确认删除吗？',{title: '警告'}, function () {
                    requestPost("{:url('delPost')}",e.currentTarget.dataset, function () {
                        location.reload();
                    });
                }, function (index) {
                    layer.close(index);
                });
            });
        });
    });
</script>
{/block}